﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wuc_car_info.ascx.cs"
    Inherits="CarLoanSystemWeb.Page.CarInfo.wuc_car_info" %>
<%@ Register Assembly="AjaxValidationSummary" Namespace="AjaxValidationSummary" TagPrefix="cc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<style type="text/css">
    .style6
    {
        width: 175px;
        font-size: small;
    }
    .style20
    {
        width: 96px;
        height: 5px;
    }
    .style21
    {
        width: 7px;
        height: 5px;
    }
    .style22
    {
        height: 5px;
    }
    .style23
    {
        width: 106px;
        height: 19px;
    }
    .style24
    {
        width: 7px;
        height: 19px;
    }
    .style25
    {
        height: 19px;
        width: 255px;
    }
</style>
<div id="box_content">
    <div id="box_content_head">
        <h1>
            รายละเอียด
        </h1>
    </div>
    <div id="box_content_body">
        <table style="height: 35px; width: 883px">
            <tr>
                <td class="style23">
                    <span class="style6">ยี่ห้อรถยนต์</span>
                </td>
                <td class="style24">
                    :
                </td>
                <td class="style25">
                    <asp:DropDownList ID="ddlBrand" runat="server" Height="23px" Width="229px" 
                        DataSourceID="SqlDataSource1" DataTextField="CAR_BRAND_NAME" 
                        DataValueField="CAR_BRAND_ID" AutoPostBack="True">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:CAR_LOANConnectionString %>" 
                        SelectCommand="SELECT [CAR_BRAND_ID], [CAR_BRAND_NAME] FROM [CAR_BRAND]">
                    </asp:SqlDataSource>
                </td>
                <td class="style20">
                    <span class="style6">รุ่นรถยนต์</span>
                </td>
                <td class="style21">
                    :
                </td>
                <td class="style22">
                    <asp:DropDownList ID="ddlModel" runat="server" Height="23px" Width="248px" 
                        DataSourceID="SqlDataSource2" DataTextField="CAR_MODEL_NAME" 
                        DataValueField="CAR_MODEL_ID">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:CAR_LOANConnectionString %>" 
                        SelectCommand="SELECT [CAR_MODEL_ID], [CAR_BRAND_ID], [CAR_MODEL_NAME] FROM [CAR_MODEL] WHERE ([CAR_BRAND_ID] = @CAR_BRAND_ID)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlBrand" Name="CAR_BRAND_ID" 
                                PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
        </table>
    </div>
    <div id="box_content_footer">
    </div>
    <div class="action" style="margin-top: 15px">
        <a href="../CarInfo/CarInfoPage.aspx" class="button reset">ตั้งค่าใหม่</a>
        <asp:LinkButton ID="btnSearch" runat="server" ValidationGroup="valElement" 
            CssClass="button find" onclick="btnSearch_Click">ค้นหา</asp:LinkButton>
    </div>
    <div id="list">
        <asp:GridView ID="gvList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            PageSize="20" Width="100%" BackColor="#FF99FF" DataKeyNames="CAR_ID"
            Style="margin-left: 0px; font-size: small;" OnRowEditing="gvList_EditCommand"
            OnPageIndexChanging="gvList_PageIndexChanging">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ButtonType="Image" EditImageUrl="~/images/Icon/find.png" HeaderText="เรียกดู"
                    ShowCancelButton="False" ShowEditButton="True" ItemStyle-Width="7%" />
                <asp:BoundField DataField="CAR_ID" HeaderText="รหัสรถยนต์" />
                <asp:BoundField DataField="CAR_BRAND_NAME" HeaderText="ยี่ห้อรถยนต์" />
                <asp:BoundField DataField="CAR_MODEL_NAME" HeaderText="รุ่นรถยนต์" />
                <asp:BoundField DataField="CAR_TYPE_ENGINE" HeaderText="ชนิดเครื่องยนต์" />
                <asp:BoundField DataField="CAR_PRICE" HeaderText="ราคา" />
            </Columns>
            <HeaderStyle BackColor="White" Height="30px" />
            <PagerSettings Mode="NumericFirstLast" />
            <RowStyle HorizontalAlign="Center" Height="20px" />
        </asp:GridView>
        <table style="width: 892px">
            <tr>
                <td style="text-align: center">
                    <asp:Label ID="lblAlert" runat="server" Text="ไม่มีข้อมูลรถยนต์" Visible="false"
                        Style="font-size: small; font-weight: 700"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
</div>